package com.aegean.MonitorExamSYS.center.action;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExamSYS.center.business.CenterBusiness;
import com.aegean.MonitorExaxSYS.model.ExamInfo;
import com.opensymphony.xwork2.ActionSupport;
@Controller("ExamValueAction")
@Scope("prototype")
public class ExamValueAction extends ActionSupport {
	@Resource
	CenterBusiness business;
	private List<ExamInfo> examValues;
	private int total;
	private int start;
	private int limit;
	private int state;
	private int small_Id;
	public int getSmall_Id() {
		return small_Id;
	}
	public void setSmall_Id(int small_Id) {
		this.small_Id = small_Id;
	}
	public List<ExamInfo> getExamValues() {
		return examValues;
	}
	public void setExamValues(List<ExamInfo> ExamValues) {
		this.examValues = ExamValues;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int getStart() {
		return start;
	}
	public void setStart(int start) {
		this.start = start;
	}
	public int getLimit() {
		return limit;
	}
	public void setLimit(int limit) {
		this.limit = limit;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	@Override
	public String execute() throws Exception {
		if(state==0){
		total=business.searchExamValueCount(small_Id);
		examValues=business.searchPartExamValues(small_Id, start, limit);
		}else if(state==1){
			examValues=business.searchLeastExams();
			total=examValues.size();
		}
		return SUCCESS;
	}
	
}
